/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package symulator8051;

/**
 *
 * @author Wojtek
 */
public class memory8051 {
	public short[] mem = new short[256];
	
	static private memory8051 instance = null;
	
	public static memory8051 getInstance(){
		if(instance == null){
			instance = new memory8051();
		}
		
		return instance;
	}
	
	public void set(int index, short value){
		mem[index] = value;
		
		
	}
	
	public short get(int index){
		return mem[index];
	}
	
	public static int stackPtr = 48;
	
	public static int R0_1 = 0;
	public static int R1_1 = 1;
	public static int R2_1 = 2;
	public static int R3_1 = 3;
	public static int R4_1 = 4;
	public static int R5_1 = 5;
	public static int R6_1 = 6;
	public static int R7_1 = 7;
	
	public static int R0_2 = 8;
	public static int R1_2 = 9;
	public static int R2_2 = 10;
	public static int R3_2 = 11;
	public static int R4_2 = 12;
	public static int R5_2 = 13;
	public static int R6_2 = 14;
	public static int R7_2 = 15;
	
	public static int R0_3 = 16;
	public static int R1_3 = 17;
	public static int R2_3 = 18;
	public static int R3_3 = 19;
	public static int R4_3 = 20;
	public static int R5_3 = 21;
	public static int R6_3 = 22;
	public static int R7_3 = 23;
	
	public static int R0_4 = 24;
	public static int R1_4 = 25;
	public static int R2_4 = 26;
	public static int R3_4 = 27;
	public static int R4_4 = 28;
	public static int R5_4 = 29;
	public static int R6_4 = 30;
	public static int R7_4 = 31;
	
	public static int P0 = 128;
	public static int P1 = 144;
	public static int P2 = 160;
	public static int P3 = 176;
	
	public static int SP = 129;
	public static int DLP = 130;
	public static int DPH = 131;
	public static int DCON = 136;
	public static int TMOD = 137;
	public static int TL0 = 138;
	public static int TL1 = 139;
	public static int TH0 = 140;
	public static int TH1 = 141;
	public static int SCON = 152;
	public static int SBUF = 153;
	public static int IE = 168;
	public static int IP = 184;
	public static int PSW = 208;
	public static int ACC = 224;
	public static int B = 240;
}
